home *** CD-ROM | disk | FTP | other *** search
- #include "ToolSort.h"
-
- /*=========================================================================
- Module: GetValidSel
-
- Purpose: Get a Selection and verify if Selection is correct type,
- correct format.
-
- Returns: Valid-Selection
-
- Functional Details:
-
- Verify if Selection Type IS 'TEXT'
- Check if last character of Selection is eol
- Report errors to user
-
- =========================================================================*/
-
- void GetValidSel(validSel)
- SelRec *validSel; /* Ptr to SelRec */
- {
- Handle scrap; /* Handle to scrap */
- //Handle selection; /* Handle to scrap */
- long length; /* Scrap length */
- long offset; /* offset to start of data */
- scrap = NewHandle(0L);
-
- length = GetScrap( scrap, 'TEXT', &offset);
- if ( length > 0 )
- {
- if ( (*scrap)[length-1] != '\r' )
- {
- length=length+1;
- SetHandleSize(scrap,length);
- (*scrap)[length-1]='\r';
- }
- validSel->sel = scrap;
- validSel->length = length;
- }
-
- }
-
-
-
-